<style>
tr.striped {
        background-color: #eeeeee;
}
</style>
<div class="box white_bg">
 <b><?=t(3006)?></b>
 <hr/>
 <br/><br/> 
<!--  use action in common module -->
<? if(isset($this->viewParams['eventList']) && count($this->viewParams['eventList']) > 0) :?>   

<!-- pagination -->
<div>
<?
$pageCount = ceil($this->viewParams['paginator']->getTotalItemCount()/$this->viewParams['paginator']->getItemCountPerPage());
?>
<? if ($pageCount > 1) :?>
	<?= $this->paginationControl($this->viewParams['paginator'], 'Sliding', '/modules/common/views/scripts/commonTheme/commonLang/common/clu-pagination-control.phtml',
							    array('searchUrl' => $this->viewParams['searchUrl'])); ?>
<?endif ?>
</div>

<div class="clear" > </div>
<div>
<?	$sess = new Zend_Session_Namespace(CLU_NS);?>
<form id ="bulk-event-form" action="/<?=$sess->viewLang?>/event/ajax/bulk-event" method="POST">
<table border = '1' width='100%' id = "show-table">
	<tr align ="center">
		<td>
			
		</td>
		<td>
			<?=t(27) ?>
		</td>
		<td>
			<?=t(13) ?>
		</td>
		<td>
			<?=t(2) ?>
		</td>
		<!--
		<td>
			<?=t(14) ?>
		</td>
		<td>
			<?=t(23) ?>
		</td>
		-->
		<td>
			<?=t(17) ?>
		</td>
		<td>
			<?=t(18) ?>
		</td>
		<td>
			<?=t(28) ?>
		</td>
		<td>
			<?=t(15) ?>
		</td>
		<td>
			<?=t(29) ?>
		</td>
	</tr>

	<? foreach ($this->viewParams['eventList'] as $row) :?>
	<tr id="event-row-<?=$row['id']?>">
		<td width = "10" align="center" valign = "top">
			<input type="checkbox" value="<?=$row['id'] ?>" class="eventIdClass" name="event_ids[<?=$row['id'] ?>]"/>
		</td>
		<td>
			#<?=$row['id']?>
		</td>
		<td>
			<a href="<?=$this->hvnUrl(array('module' => 'event', 'action' => 'view'))?>?id=<?=$row['id']?>" > <?=$row['title'] ?></a>
		</td>
		<td id= "event-status-<?=$row['id'] ?>">
			<?=$row['status'] ?>
		</td>
		<!--
		<td>
			<?=$row['category'] ?>
		</td>
		<td>
			<?=$row['frequency'] ?>
		</td>
		-->
		<td>
			<?if($row['startHour'] < 10) echo "0"?><?=$row['startHour'] ?>:<?if($row['startMinute'] < 10) echo "0"?><?=$row['startMinute'] ?>
			<?if(isset($row['startDate'])) echo $row['startDate'] ?>
		</td>
		<td>
			<?if($row['finishHour'] < 10) echo "0"?><?=$row['finishHour'] ?>:<?if($row['finishMinute'] < 10) echo "0"?><?=$row['finishMinute'] ?>
			<?if(isset($row['finishDate'])) echo $row['finishDate'] ?>
		</td>
		<td>
			<?if(isset($row['calendarType'])) echo $row['calendarType'] ?>
		</td>
		<td>
			<?=$row['keywords'] ?>
		</td>
    	<td width="20%"><a href="<?=$this->hvnUrl(array('module' => 'event', 'action' => 'edit'))?>?id=<?=$row['id']?>"><?=t(38) ?></a>
            <a id = "delete-event-<?=$row['id']?>" href="javascript:void()"><?=t(31) ?></a>|
            <a href="<?=$this->hvnUrl(array('module' => 'article', 'action' => 'translate'))?>?id=<?=$row['article_id']?>&to=en"><?=t(90)?></a>
        </td> 
	</tr>
	<?endforeach ?>
</table>

	<!-- pagination -->
	<div>
	<?
	$pageCount = ceil($this->viewParams['paginator']->getTotalItemCount()/$this->viewParams['paginator']->getItemCountPerPage());
	?>
	<? if ($pageCount > 1) :?>
		<?= $this->paginationControl($this->viewParams['paginator'], 'Sliding', '/modules/common/views/scripts/commonTheme/commonLang/common/clu-pagination-control.phtml',
								    array('searchUrl' => $this->viewParams['searchUrl'])); ?>
	<?endif ?>
	</div>
       
       <div class="clear"></div>


	<div  style="background-color:#EEEEEE">
		<?=t(30) ?>: 
		<select name='bulkaction' id ="bulk" >
		<?if(true): //TODO: isadmin()?>
		<option value='delete'> <?=t(31) ?> </option>
		<?endif ?>
		<option value='status'> <?=t(32) ?> </option>
		</select>
		
		<select name='changestatus' id ="changeStatus" style="display:none">
		<option value='featured'> <?=t(33) ?> </option>
		<option value='published'> <?=t(34) ?> </option>
		<option value='queued'> <?=t(35) ?> </option>
		<option value='unpublished'> <?=t(36) ?> </option>
		<option value='deleted'> <?=t(37) ?> </option>
		</select>
		<input type="submit" value="Apply" id="bulk-submit" name="op"/>
	</div>
</form>
</div>
<?else:?>
<?=sprintf(t(144), t(201)) ?>
<?endif ?>    

</div>
